| Conditions | 3 | 
| Paths | 2 | 
| Total Lines | 21 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 2 | ||
| Bugs | 0 | Features | 0 | 
| 1 | import path from 'path'  | 
            ||
| 8 | var route = function(req, res, next){ | 
            ||
| 9 |   abeExtend.hooks.instance.trigger('beforeRoute', req, res, next) | 
            ||
| 10 | if(typeof res._header !== 'undefined' && res._header !== null) return  | 
            ||
| 11 | |||
| 12 | var p = cmsOperations.post.publish(  | 
            ||
| 13 | req.body.filePath,  | 
            ||
| 14 | req.body.tplPath,  | 
            ||
| 15 | req.body.json  | 
            ||
| 16 | );  | 
            ||
| 17 | |||
| 18 |   p.then((result) => { | 
            ||
| 19 |     res.set('Content-Type', 'application/json') | 
            ||
| 20 | res.send(JSON.stringify(result))  | 
            ||
| 21 | },  | 
            ||
| 22 |   (result) => { | 
            ||
| 23 |     res.set('Content-Type', 'application/json') | 
            ||
| 24 | res.send(JSON.stringify(result))  | 
            ||
| 25 |   }).catch(function(e) { | 
            ||
| 26 |     console.error('[ERROR] post-publish.js', e) | 
            ||
| 27 | })  | 
            ||
| 28 | }  | 
            ||
| 29 | |||
| 30 | export default route  |